<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>链云后台管理系统</title>
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.8.0/font/bootstrap-icons.css">
    <style>
        :root {
            --primary-color: #1a2b4c;
            --sidebar-width: 240px;
            --sidebar-bg: var(--primary-color);
            --header-height: 60px;
        }

        body {
            font-family: "Microsoft YaHei", sans-serif;
            background-color: #f5f7fa;
            overflow-x: hidden;
        }

        #app {
            display: flex;
            min-height: 100vh;
        }

        /* 侧边栏样式 */
        .sidebar {
            width: var(--sidebar-width);
            background: var(--sidebar-bg);
            color: white;
            position: fixed;
            height: 100%;
            z-index: 100;
            transition: all 0.3s;
            box-shadow: 3px 0 10px rgba(0,0,0,0.1);
        }

        .sidebar-header {
            padding: 20px;
            text-align: center;
            border-bottom: 1px solid rgba(255,255,255,0.1);
        }

        .nav-link {
            color: rgba(255,255,255,0.8);
            padding: 12px 20px;
            border-left: 3px solid transparent;
            transition: all 0.2s;
        }

        .nav-link:hover, .nav-link.active {
            color: white;
            background: rgba(255,255,255,0.1);
            border-left: 3px solid #3b7ddd;
        }

        .nav-link i {
            margin-right: 10px;
            font-size: 1.2rem;
        }

        .sub-menu {
            padding-left: 40px;
            background: rgba(0,0,0,0.1);
        }

        .sub-menu .nav-link {
            padding: 8px 20px;
            font-size: 0.9rem;
        }

        /* 主内容区样式 */
        .main-content {
            flex: 1;
            margin-left: var(--sidebar-width);
            transition: all 0.3s;
        }

        .top-header {
            height: var(--header-height);
            background: white;
            box-shadow: 0 2px 5px rgba(0,0,0,0.05);
            display: flex;
            align-items: center;
            padding: 0 25px;
        }

        .breadcrumb {
            background: none;
            margin-bottom: 0;
            font-size: 0.9rem;
        }

        .breadcrumb-item + .breadcrumb-item::before {
            color: #6c757d;
        }

        .content-wrapper {
            padding: 20px;
        }

        .card {
            border: none;
            box-shadow: 0 1px 3px rgba(0,0,0,0.1);
            margin-bottom: 20px;
        }

        .card-header {
            background: white;
            border-bottom: 1px solid #eaeaea;
            padding: 15px 20px;
            font-weight: 600;
        }

        /* 表格样式 */
        .table th {
            font-weight: 600;
            background: #f8f9fa;
        }

        .status-badge {
            padding: 5px 10px;
            border-radius: 20px;
            font-size: 0.85rem;
        }

        .status-active {
            background: #d4edda;
            color: #155724;
        }

        .page-info {
            font-size: 0.9rem;
            color: #6c757d;
        }

        /* 搜索框和按钮样式 */
        .search-container {
            display: flex;
            gap: 10px;
            margin-bottom: 20px;
        }

        .search-container .form-control {
            max-width: 300px;
        }

        .btn-add {
            background: var(--primary-color);
            border: none;
            color: white;
            display: flex;
            align-items: center;
        }

        .btn-add i {
            margin-right: 5px;
        }

        /* 页脚样式 */
        .footer {
            background: white;
            padding: 15px 20px;
            border-top: 1px solid #eaeaea;
            color: #6c757d;
            font-size: 0.85rem;
        }
    </style>
</head>
<body>
    <div id="app">
        <!-- 左侧导航栏 -->
        <div class="sidebar">
            <div class="sidebar-header">
                <h4 class="mb-0">链云后台管理系统</h4>
                <small class="text-white-50">某柠檬_柠檬味的导航</small>
            </div>

            <nav class="mt-4">
                <div class="nav flex-column">
                    <a class="nav-link" href="#">
                        <i class="bi bi-house-door"></i> 首页
                    </a>

                    <div class="dropdown-title" data-bs-toggle="collapse" href="#deviceManagement">
                        <a class="nav-link" href="#">
                            <i class="bi bi-device-ssd"></i> 设备管理
                        </a>
                    </div>

                    <div class="collapse show" id="deviceManagement">
                        <div class="sub-menu">
                            <a class="nav-link" href="#"><i class="bi bi-app"></i> 产品分类</a>
                            <a class="nav-link" href="#"><i class="bi bi-list-check"></i> 产品管理</a>
                            <a class="nav-link" href="#"><i class="bi bi-hdd-stack"></i> 产品固件</a>
                            <a class="nav-link active" href="#"><i class="bi bi-tag"></i> 设备类型</a>
                        </div>
                    </div>

                    <a class="nav-link" href="#">
                        <i class="bi bi-building"></i> 企业管理
                    </a>

                    <a class="nav-link" href="#">
                        <i class="bi bi-gear"></i> 系统管理
                    </a>

                    <a class="nav-link" href="#">
                        <i class="bi bi-graph-up"></i> 数据统计
                    </a>

                    <a class="nav-link" href="#">
                        <i class="bi bi-tools"></i> 系统工具
                    </a>

                    <a class="nav-link" href="#">
                        <i class="bi bi-headset"></i> 平台服务
                    </a>
                </div>
            </nav>

            <div class="position-absolute bottom-0 start-0 w-100 p-3 text-white text-center">
                <small>ctl.lianyuncloud.cn/device/device_type</small>
            </div>
        </div>

        <!-- 主内容区 -->
        <div class="main-content">
            <!-- 顶部面包屑导航 -->
            <div class="top-header">
                <nav aria-label="breadcrumb">
                    <ol class="breadcrumb">
                        <li class="breadcrumb-item"><a href="#">首页</a></li>
                        <li class="breadcrumb-item"><a href="#">设备管理</a></li>
                        <li class="breadcrumb-item active" aria-current="page">设备类型</li>
                    </ol>
                </nav>

                <div class="ms-auto d-flex align-items-center">
                    <div class="input-group input-group-sm" style="max-width: 200px;">
                        <input type="text" class="form-control form-control-sm" placeholder="在这里输入你要搜索的内容">
                        <button class="btn btn-outline-secondary" type="button">
                            <i class="bi bi-search"></i>
                        </button>
                    </div>
                </div>
            </div>

            <!-- 内容区域 -->
            <div class="content-wrapper">
                <!-- 顶部搜索和新增按钮 -->
                <div class="d-flex justify-content-between align-items-center mb-4">
                    <h4>设备类型</h4>

                    <div class="search-container">
                        <div class="input-group">
                            <input type="text" class="form-control" placeholder="请输入类别名称">
                            <button class="btn btn-outline-secondary" type="button">搜索</button>
                        </div>

                        <select class="form-select">
                            <option selected>状态</option>
                            <option value="1">正常</option>
                            <option value="0">禁用</option>
                        </select>

                        <button class="btn btn-add">
                            <i class="bi bi-plus"></i> 新增
                        </button>
                    </div>
                </div>

                <!-- 设备类型表格 -->
                <div class="card">
                    <div class="card-header">设备类型列表</div>

                    <div class="card-body">
                        <div class="table-responsive">
                            <table class="table table-hover">
                                <thead>
                                    <tr>
                                        <th>设备类型名称</th>
                                        <th>类型标识</th>
                                        <th>状态</th>
                                        <th>备注</th>
                                        <th>操作</th>
                                    </tr>
                                </thead>
                                <tbody>
                                    <tr>
                                        <td>卷帘机</td>
                                        <td>roller</td>
                                        <td>
                                            <span class="status-badge status-active">正常</span>
                                        </td>
                                        <td>正常</td>
                                        <td>
                                            <button class="btn btn-sm btn-outline-primary">修改</button>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>放风机</td>
                                        <td>fan</td>
                                        <td>
                                            <span class="status-badge status-active">正常</span>
                                        </td>
                                        <td>放风机</td>
                                        <td>
                                            <button class="btn btn-sm btn-outline-primary">修改</button>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>水肥一体机</td>
                                        <td>wf</td>
                                        <td>
                                            <span class="status-badge status-active">正常</span>
                                        </td>
                                        <td>水肥一体机</td>
                                        <td>
                                            <button class="btn btn-sm btn-outline-primary">修改</button>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>气象站</td>
                                        <td>ms</td>
                                        <td>
                                            <span class="status-badge status-active">正常</span>
                                        </td>
                                        <td>气象站</td>
                                        <td>
                                            <button class="btn btn-sm btn-outline-primary">修改</button>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>电子秤</td>
                                        <td>es</td>
                                        <td>
                                            <span class="status-badge status-active">正常</span>
                                        </td>
                                        <td>电子秤</td>
                                        <td>
                                            <button class="btn btn-sm btn-outline-primary">修改</button>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>无线温湿度传感器</td>
                                        <td>wths</td>
                                        <td>
                                            <span class="status-badge status-active">正常</span>
                                        </td>
                                        <td>无线温湿度传感器</td>
                                        <td>
                                            <button class="btn btn-sm btn-outline-primary">修改</button>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>摄像头</td>
                                        <td>camera</td>
                                        <td>
                                            <span class="status-badge status-active">正常</span>
                                        </td>
                                        <td>摄像头</td>
                                        <td>
                                            <button class="btn btn-sm btn-outline-primary">修改</button>
                                        </td>
                                    </tr>
                                </tbody>
                            </table>
                        </div>

                        <!-- 分页控件 -->
                        <div class="d-flex justify-content-between align-items-center mt-4">
                            <div class="page-info">
                                <span>共7条</span>
                                <select class="form-select form-select-sm d-inline-block w-auto mx-2">
                                    <option>10条/页</option>
                                    <option>20条/页</option>
                                    <option>50条/页</option>
                                </select>
                            </div>

                            <nav>
                                <ul class="pagination pagination-sm mb-0">
                                    <li class="page-item disabled">
                                        <a class="page-link" href="#" tabindex="-1" aria-disabled="true">上一页</a>
                                    </li>
                                    <li class="page-item active"><a class="page-link" href="#">1</a></li>
                                    <li class="page-item"><a class="page-link" href="#">2</a></li>
                                    <li class="page-item"><a class="page-link" href="#">3</a></li>
                                    <li class="page-item">
                                        <a class="page-link" href="#">下一页</a>
                                    </li>
                                    <li class="page-item ms-2">
                                        <div class="input-group input-group-sm" style="width: 80px;">
                                            <input type="text" class="form-control" placeholder="1">
                                            <button class="btn btn-outline-secondary" type="button">前往</button>
                                        </div>
                                    </li>
                                </ul>
                            </nav>
                        </div>
                    </div>
                </div>
            </div>

            <!-- 页脚 -->
            <div class="footer">
                <div class="d-flex justify-content-between align-items-center">
                    <div>
                        <span>20:33</span>
                        <span class="mx-2">|</span>
                        <span>2025/6/6</span>
                        <span class="mx-2">|</span>
                        <span>链云后台管理系统</span>
                    </div>
                    <div>
                        <span>页面版本: v1.2.5</span>
                    </div>
                </div>
            </div>
        </div>
    </div>

    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
    <script>
        // 侧边栏折叠功能
        document.querySelectorAll('.dropdown-title').forEach(title => {
            title.addEventListener('click', function() {
                const target = this.getAttribute('data-bs-target');
                const collapse = document.querySelector(target);

                // 如果当前已展开，则关闭其他所有展开的菜单
                if (!collapse.classList.contains('show')) {
                    document.querySelectorAll('.collapse').forEach(c => {
                        if (c.id !== target.substring(1) && c.classList.contains('show')) {
                            c.classList.remove('show');
                        }
                    });
                }
            });
        });
    </script>
</body>
</html>